Local deployment of digital garden
The Digital Garden plugin is fantastic. It's free and open source, and the service it depends on, Vercel, has a free version.
However, the free version of Vercel has a limit on the number of deployments, which is 100 per day. We may run out of the quota if we want to tune some details.
Thankfully, the plugin's author provided a local deployment method that works well.
I just put some details in here for documentation.
Full discussion: Local deployment · oleeskild/obsidian-digital-garden · Discussion (github.com)
- Clone the digital garden repo (we might have done this before if we've already modified the
custom-style.scss
or other files to customize our garden) - In terminal, cd to the repo folder, type
npm install express --save
> cd <path to the repo>
> npm install express --save
- On the same place, add a new file
app.js
with the following content:
const express = require('express')
const app = express()
const port = 8080;
app.use(express.static('dist'))
app.get('*', (req, res)=>{
res.redirect("/404")
})
app.listen(port, () => {
console.log(`Digital garden running on port ${port}`)
})
If we just paste the original code and execute app.js
in the last step, we might get an error Error: Cannot find module './netlify/functions/search/search.js'
, so we remove the code related to it.
- On terminal, execute the following:
> npm install
> npm run build
> node app.js
- On the browser, type
localhost:8080
, our garden should appear
After we made some changes, to see the new contents, first type ctrl
+ c
to interrupt the current one, then type npm run build
and node app.js
again.
References
-
Steensen, O. E. (2024). oleeskild/obsidian-digital-garden [TypeScript]. https://github.com/oleeskild/obsidian-digital-garden (Original work published 2022)
-
oleeskild/obsidian-digital-garden · Discussions · GitHub. (n.d.). GitHub. Retrieved September 16, 2024, from https://github.com/oleeskild/obsidian-digital-garden/discussions?discussions_q=local